DISTSPHERICAL
The DISTSPHERICAL
field specifier allows you to find documents that define a location (latitude and longitude) that is within a specified distance from a specified point.
You can specify the document location using either a pair of fields (corresponding to latitude and longitude values), or a unified
TIP: If your document location field contains any shape other than a point, IDOL calculates distances from the geometric center of the shape.
Format
FieldText=DISTSPHERICAL{lat,long,dist}:LOCATION
lat
|
The specified latitude. Specify latitude positions south of the equator as negative. |
long
|
The specified longitude. Specify longitude positions west of the Greenwich Meridian as negative. |
dist
|
The distance in kilometers from the specified latitude and longitude. |
LOCATION
|
The document field or fields that contain the location value. You can use one of the following options to specify location fields:
You can specify multiple options for the location fields, in the form NOTE: If you use multiple position fields or field pairs, IDOL Content Component cannot match documents where a pair of split geospatial fields occurs interleaved with other geospatial fields. For example, if you use In such cases, you can rewrite the query, in the form |
NOTE: You can optimize this field specifier by configuring your coordinate fields with the
Examples
FieldText=DISTSPHERICAL{37.75,-122.4,20}:LAT:LONG
This example matches all documents whose position is within a 20 kilometer radius of San Francisco (37.75N,122.4W). The latitude and longitude position of a document in this example is contained in the fields LAT
and LONG
, respectively.
FieldText=DISTSPHERICAL{52.2,0.1,20}:LOCATION:LAT:LONG
This example matches all documents whose position is within a 20 kilometer radius of Cambridge (52.2N,0.1W). The latitude and longitude position of a document in this example is contained in either the (unified) LOCATION
field, or the LAT
and LONG
fields.